<template>
  <h1>我是About组件中的内容</h1>
</template>
<script>
export default {
  name: "About",
  //通过路由规则，进入该组件时被调用
  beforeRouteEnter(to, from, next) {
    if (to.meta.isAuth) {
      if (localStorage.getItem("school") === "laoheixueyuan") {
        next();
      } else {
        alert("学校名称不对，无法查看信息");
      }
    } else {
      next();
    }
  },

  //通过路由规则，离开该组件时被调用
  beforeRouteLeave(to, from, next) {
    next()
  },
};
</script>

